cmake_minimum_required (VERSION 3.1)

# cmake -DCMAKE_TOOLCHAIN_FILE=../fuxi_setup.cmake -DDEBUG=OFF ..

project(wwan C)

set(APN_NAME_LEN 128)
set(ROUTE_IP_LEN 16)
set(ROUTE_IP_NUM 128)
set(JSON_LEN 2048)

##设置C编译参数
#O0 ->O1->O2->O3 O0表示不优化
#-Wall生成警告信息
#-g生成调试信息
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -O0 -Wall")

# debug message
option(DEBUG "debug flag..." OFF)
if(DEBUG)
add_definitions(-DDEBUG -DDEBUG_TIME)
endif(DEBUG)

configure_file(
    "${PROJECT_SOURCE_DIR}/wwan_conf.h.in"
    "${PROJECT_BINARY_DIR}/wwan_conf.h")


file(GLOB_RECURSE SOURCES
    "${PROJECT_SOURCE_DIR}/src/*.c"
)

include_directories(
    "${PROJECT_SOURCE_DIR}/src"
	"${PROJECT_BINARY_DIR}"
)


link_libraries(pthread)

add_executable(${PROJECT_NAME} ${SOURCES})

# ---  输出目标路径
SET(EXECUTABLE_OUTPUT_PATH ${PROJECT_SOURCE_DIR}/target/${PLATFORM_NAME})
message("Set target to ${EXECUTABLE_OUTPUT_PATH}")

set(CMAKE_VERBOSE_MAKEFILE ON)
